Skip to content

Conversation

@shbhmexe
Copy link

Description:
This PR addresses several easy to medium-level code quality issues identified during a repository audit.

Changes:

  1. util/landgraph/landgraph.js:

    • Fixed a typo in the out option definition: typelabel -> typeLabel. This ensures the help text displays correctly.
    • Fixed a logic error in the help condition. Previously if (options.help || options) was always true. Changed to if (options.help || Object.keys(options).length === 0) to correctly show help only when requested or no options are provided.
  2. generate-entities.sh:

    • Added a missing comma after the description field in the JMESPath query. This fixes a syntax error in the JSON projection.
  3. cleanup.sh:

    • Updated the find and xargs command to use -print0 and -0 respectively. This handles filenames with spaces or special characters correctly.
    • Removed the non-portable -d flag from find.
    • Removed the unnecessary {} placeholder from xargs.

Impact:
These changes improve the correctness, stability, and portability of the codebase. No existing functionality is altered or broken.

Verification:

  • Verified syntax for all modified scripts.
  • Confirmed landgraph.js help logic now works as expected.
  • Confirmed generate-entities.sh query syntax is valid.
  • Confirmed cleanup.sh command is syntactically correct and portable.

Checklist:

  • Changes do not break any existing functionality
  • Commit message follows DCO sign-off
  • Branch name follows conventions

- Fix typo in landgraph.js option definition (typelabel -> typeLabel)
- Fix logic error in landgraph.js help condition
- Fix invalid JMESPath syntax in generate-entities.sh
- Fix incorrect xargs usage in cleanup.sh for better portability

Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant